//
//  XMMeetDetailView.m
//  XMJJ_zml
//
//  Created by 丁浩 on 2025/6/11.
//

#import "XMMeetDetailView.h"
#import "SDCycleScrollView.h"
#import "XMEvaluateView.h"
#import "XMEvaluateCell.h"

@interface XMMeetDetailView ()<SDCycleScrollViewDelegate>

@property (nonatomic, strong) UIButton *attentionBtn;
@property (nonatomic, strong) UIScrollView *bodyScrollView;
@property (nonatomic, strong) SDCycleScrollView *sdcycleView;
@property (nonatomic, strong) UIImageView *topAvatarImgView;
@property (nonatomic, strong) UILabel *topNameLabel;
@property (nonatomic, strong) UILabel *priceLabel;
@property (nonatomic, strong) UILabel *titleLabel;

@property (nonatomic, strong) UIView *meetInfoView;    //基本信息
@property (nonatomic, strong) UILabel *addressLabel;
@property (nonatomic, strong) UILabel *startTimeLabel;
@property (nonatomic, strong) UILabel *endTimeLabel;

@property (nonatomic, strong) UIView *descriptionView;    //描述
@property (nonatomic, strong) UILabel *descriptionLabel;

@property (nonatomic, strong) UIView *evaluateBgView;  //评价
@property (nonatomic, strong) XMEvaluateView *evaluateView;

@property (nonatomic, strong) UIView *userInfoBgView;
@property (nonatomic, strong) UIButton *meetNumBtn;
@property (nonatomic, strong) UIButton *collectBtn; //收藏

@property (nonatomic, strong) UIView *bottomView;

@property (nonatomic, copy) NSString *userId;
@property (nonatomic, copy) NSString *attentionStatus;


@end

@implementation XMMeetDetailView

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        [self creatUI];
    }
    return self;
}

- (void)creatUI {
    [self addSubview:self.navView];
    self.navView.backgroundColor = kColorHEX(0xffffff);
    self.backgroundColor = kColorHEX(0xF0F0F0);
    
    [self.navView addSubview:self.topAvatarImgView];
    [self.navView addSubview:self.topNameLabel];
    
    //关注
    UIButton *attentionBtn = [UIButton buttonWithType:UIButtonTypeCustom font:KFontSize(13.0) frame:CGRectMake(self.navView.width - KScaleWidth(44.0) - KScaleWidth(50.0), kNavagationBarH - 44 + (44 - KScaleWidth(28.0))/2, KScaleWidth(50.0), KScaleWidth(28.0)) title:@"关注" selectTitle:@"已关注" titleColor:kColorHEX(0x333333) selectColor:kColorHEX(0x333333)];
    [attentionBtn setBackgroundImage:[UIImage imageWithColor:kColorHEX(0xFFD800)] forState:UIControlStateNormal];
    [attentionBtn setBackgroundImage:[UIImage imageWithColor:kColorHEX(0x999999)] forState:UIControlStateSelected];
//    attentionBtn.backgroundColor = kColorHEX(0xFFD800);
    [attentionBtn setCornerRadius:attentionBtn.height/2];
    [attentionBtn addTarget:self action:@selector(attentionAction:) forControlEvents:UIControlEventTouchUpInside];
    _attentionBtn = attentionBtn;
    [self.navView addSubview:attentionBtn];
    //分享
    UIButton *shareBtn = [UIButton buttonWithType:UIButtonTypeCustom frame:CGRectMake(self.navView.width - KScaleWidth(8.0) - KScaleWidth(28.0), attentionBtn.y, KScaleWidth(28.0), KScaleWidth(28.0)) image:@"detail_share_icon" selectImg:@"detail_share_icon"];
    [shareBtn addTarget:self action:@selector(shareAction:) forControlEvents:UIControlEventTouchUpInside];
    [self.navView addSubview:shareBtn];
    
    [self addSubview:self.bodyScrollView];
    //轮播 价格
    UIView *topBgView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.width, KScaleWidth(345.0))];
    topBgView.backgroundColor = kColorHEX(0xffffff);
    [_bodyScrollView addSubview:topBgView];
    [topBgView addSubview:self.sdcycleView];
    [topBgView addSubview:self.priceLabel];
    [topBgView addSubview:self.titleLabel];
    UILabel *explainLabel = [[UILabel alloc] initWithFrame:CGRectMake(KScaleWidth(150.0), _priceLabel.y, topBgView.width - KScaleWidth(150.0) - KScaleWidth(8.0), _priceLabel.height) font:KFontSize(13.0) textColor:kColorHEX(0x999999) textAlignment:NSTextAlignmentRight];
    explainLabel.text = @"买家已经承诺技能真实，内容真实 >";
    [topBgView addSubview:explainLabel];
    
    //基本信息
    [_bodyScrollView addSubview:self.meetInfoView];
    _meetInfoView.y = topBgView.maxY + KScaleWidth(8.0);
    [_meetInfoView addSubview:self.addressLabel];
    [_meetInfoView addSubview:self.startTimeLabel];
    [_meetInfoView addSubview:self.endTimeLabel];
    {
        NSArray *titleArr = @[@"见面位置", @"见面时间", @"见面结束时间"];
        for (int i = 0; i < titleArr.count; i ++) {
            UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(KScaleWidth(8.0), KScaleWidth(40)*i, KScaleWidth(150.0), KScaleWidth(40.0)) font:KFontSize(14.0) textColor:kColorHEX(0x666666)];
            titleLabel.text = titleArr[i];
            [_meetInfoView addSubview:titleLabel];
            UIView *lineView = [[UIView alloc] initWithFrame:CGRectMake(KScaleWidth(8.0), titleLabel.maxY, _meetInfoView.width - KScaleWidth(8.0)*2, 1)];
            lineView.backgroundColor = kColorHEX(0xf0f0f0);
            [_meetInfoView addSubview:lineView];
        }
    }
    //描述
    [_bodyScrollView addSubview:self.descriptionView];
    _descriptionView.y = _meetInfoView.maxY + KScaleWidth(8.0);
    {
        UILabel *descTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(KScaleWidth(8.0), KScaleWidth(8.0), _descriptionView.width - KScaleWidth(8.0)*2, KScaleWidth(22.0)) font:KBoldFontSize(16.0) textColor:kColorHEX(0x333333)];
        descTitleLabel.text = @"服务描述";
        [_descriptionView addSubview:descTitleLabel];
        [_descriptionView addSubview:self.descriptionLabel];
        
//        UIButton *openBtn = [UIButton buttonWithType:UIButtonTypeCustom font:KFontSize(14.0) frame:CGRectMake(0, descTitleLabel.maxY, _descriptionView.width, KScaleWidth(44.0)) title:@"展开" titleColor:kColorHEX(0x999999) image:@"home_detail_open_icon"];
//        [openBtn addTarget:self action:@selector(openAction:) forControlEvents:UIControlEventTouchUpInside];
//        [_descriptionView addSubview:openBtn];
    }
    [_bodyScrollView addSubview:self.evaluateBgView];
    _evaluateBgView.y = _descriptionView.maxY + KScaleWidth(8.0);
    [_evaluateBgView addSubview:self.evaluateView];
    
    [_bodyScrollView addSubview:self.userInfoBgView];
    _userInfoBgView.y = _evaluateBgView.maxY + KScaleWidth(8.0);
    {
        UIImageView *avatarImgView = [[UIImageView alloc] initWithFrame:CGRectMake(KScaleWidth(8.0), KScaleWidth(16.0), KScaleWidth(36.0), KScaleWidth(36.0))];
        [avatarImgView setCornerRadius:avatarImgView.height/2];
        [_userInfoBgView addSubview:avatarImgView];
        UILabel *nameLabel = [[UILabel alloc] initWithFrame:CGRectMake(avatarImgView.maxX + KScaleWidth(8.0), KScaleWidth(15.0), _userInfoBgView.width - avatarImgView.maxX - KScaleWidth(8.0), KScaleWidth(24.0)) font:KFontSize(16.0) textColor:kColorHEX(0x333333)];
        [_userInfoBgView addSubview:nameLabel];
        
        UIButton *goHomePageBtn = [UIButton buttonWithType:UIButtonTypeCustom font:KFontSize(14.0) frame:CGRectMake(_userInfoBgView.width - KScaleWidth(90.0), (_userInfoBgView.height - KScaleWidth(40.0))/2, KScaleWidth(90.0), KScaleWidth(40.0)) title:@"进入主页" titleColor:kColorHEX(0x999999) image:@"next_icon_gray"];
        [goHomePageBtn addTarget:self action:@selector(goHomePageAction:) forControlEvents:UIControlEventTouchUpInside];
        [_userInfoBgView addSubview:goHomePageBtn];
        _meetNumBtn = [UIButton buttonWithType:UIButtonTypeCustom font:KFontSize(13.0) frame:CGRectMake(nameLabel.x, nameLabel.maxY, KScaleWidth(90.0), KScaleWidth(18.0)) title:@"" titleColor:kColorHEX(0x3B5998)];
        [_meetNumBtn setContentHorizontalAlignment:UIControlContentHorizontalAlignmentLeft];
        [_userInfoBgView addSubview:_meetNumBtn];
    }
    
    UIView *bottomView = [[UIView alloc] initWithFrame:CGRectMake(0, self.height - KScaleWidth(65.0) - kBottomLayout, self.width, KScaleWidth(65.0) + kBottomLayout)];
    _bottomView = bottomView;
    [self addSubview:bottomView];
    {
        NSArray *titleArr = @[@"收藏", @"聊一聊", @"见面箱"];
        NSArray *imgArr = @[@"detail_collection_icon", @"detail_chat_icon", @"detail_meet_box_icon"];
        for (int i = 0; i < 3; i ++) {
            UIButton *itemBtn = [UIButton buttonWithType:UIButtonTypeCustom font:KFontSize(12.0)frame:CGRectMake(KScaleWidth(52.0)*i, 0, KScaleWidth(42.0), KScaleWidth(65.0)) title:titleArr[i] titleColor:kColorHEX(0x999999) image:imgArr[i]];
            [itemBtn layoutButtonWithEdgeInsetsStyle:CSButtonEdgeInsetsStyleTop ImageTitleSpace:KScaleWidth(5.0)];
            [itemBtn addTarget:self action:@selector(itemAction:) forControlEvents:UIControlEventTouchUpInside];
            [bottomView addSubview:itemBtn];
            if (i == 0) {
                _collectBtn = itemBtn;
                [itemBtn setTitleColor:kColorHEX(0xFF5A07) forState:UIControlStateSelected];
                [_collectBtn setImage:ImageNamed(@"detail_collection_icon_select") forState:UIControlStateSelected];
            }
        }
        UIButton *addBtn = [UIButton buttonWithType:UIButtonTypeCustom font:KFontSize(13.0) frame:CGRectMake(bottomView.width - KScaleWidth(96.0) - KScaleWidth(93.0), KScaleWidth(16.0), KScaleWidth(93.0), KScaleWidth(28.0)) title:@"加入见面箱" titleColor:kColorHEX(0x333333)];
        [addBtn setRadius:addBtn.height/2 borderColor:kColorHEX(0x979797) borderWidth:1.5];
        [addBtn addTarget:self action:@selector(addAction:) forControlEvents:UIControlEventTouchUpInside];
        [bottomView addSubview:addBtn];
        
        UIButton *orderBtn = [UIButton buttonWithType:UIButtonTypeCustom font:KFontSize(13.0) frame:CGRectMake(bottomView.width - KScaleWidth(8.0) - KScaleWidth(80.0), addBtn.y, KScaleWidth(80.0), KScaleWidth(28.0)) title:@"立即下单" titleColor:kColorHEX(0x333333)];
        orderBtn.backgroundColor = kColorHEX(0xFFD800);
        [orderBtn setCornerRadius:orderBtn.height/2];
        [orderBtn addTarget:self action:@selector(orderAction:) forControlEvents:UIControlEventTouchUpInside];
        [bottomView addSubview:orderBtn];
    }
    _bodyScrollView.contentSize = CGSizeMake(_bodyScrollView.width, MAX(_bodyScrollView.height, _userInfoBgView.maxY + KScaleWidth(8.0)));
}

- (void)setContentWithDetailModel:(XMMeetDetailModel *)detailModel {
    _userId = detailModel.authorVo.objectId;
    _attentionStatus = detailModel.followStatus;
    _attentionBtn.selected = [detailModel.followStatus isEqualToString:@"1"];
    _topNameLabel.text = detailModel.authorVo.nickname;
    [_meetNumBtn setTitle:[NSString stringWithFormat:@"在售%@个见面", detailModel.authorVo.serviceNum] forState:UIControlStateNormal];
    [_topAvatarImgView sd_setImageWithURL:[NSURL URLWithString:detailModel.authorVo.avatar] placeholderImage:ImageNamed(@"mine_avatar_icon")];
    _sdcycleView.imageURLStringsGroup = [detailModel.imgs componentsSeparatedByString:@","];
    NSString *priceStr = [NSString stringWithFormat:@"¥%@", detailModel.totalPrice];
    NSMutableAttributedString *priceAttr = [[NSMutableAttributedString alloc] initWithString:priceStr attributes:@{NSFontAttributeName : KBoldFontSize(24.0), NSForegroundColorAttributeName : kColorHEX(0xDD4B39)}];
    [priceAttr addAttributes:@{NSFontAttributeName: KBoldFontSize(12.0)} range:NSMakeRange(0, 1)];
    [_priceLabel setAttributedText:priceAttr];
    CGFloat titleHeight = [detailModel.title getHeightWithFont:KScaleWidth(16.0) withWidth:_titleLabel.width] + KScaleWidth(10.0);
    _titleLabel.height = MAX(titleHeight, KScaleWidth(28.0));
    _titleLabel.text = detailModel.title;
    _titleLabel.superview.height = _titleLabel.maxY + KScaleWidth(10.0);
    _meetInfoView.y = _titleLabel.superview.maxY + KScaleWidth(8.0);
    if (!detailModel.addrProvince) {
        detailModel.addrProvince = @"";
    }
    if (!detailModel.addrCity) {
        detailModel.addrCity = @"";
    }
    if (!detailModel.addrDetail) {
        detailModel.addrDetail = @"";
    }
    _addressLabel.text = [NSString stringWithFormat:@"%@%@%@", detailModel.addrProvince, detailModel.addrCity, detailModel.addrDetail];
    _startTimeLabel.text = detailModel.startTimeStr;
    _endTimeLabel.text = detailModel.endTimeStr;
    
    CGFloat desHeight = [detailModel.descriptionStr getHeightWithFont:KScaleWidth(14.0) withWidth:_descriptionLabel.width] + KScaleWidth(10.0);
    _descriptionLabel.height = MAX(desHeight, KScaleWidth(20.0));
    _descriptionView.y = _meetInfoView.maxY + KScaleWidth(8.0);
    _descriptionView.height = _descriptionLabel.maxY + KScaleWidth(10.0);
    _descriptionLabel.text = detailModel.descriptionStr;
    
    if (detailModel.itemVo.objectId && detailModel.itemVo.objectId.length > 0) {
        _evaluateBgView.hidden = NO;
        _evaluateBgView.y = _descriptionView.maxY + KScaleWidth(8.0);
        [_evaluateView setContentWithEvaluateModel:detailModel.itemVo];
        _evaluateBgView.height = _evaluateView.height + KScaleWidth(38.0);
        _userInfoBgView.y = _evaluateBgView.maxY + KScaleWidth(8.0);
    }
    else {
        _evaluateBgView.hidden = YES;
        _userInfoBgView.y = _descriptionView.maxY + KScaleWidth(8.0);
    }
    _bodyScrollView.contentSize = CGSizeMake(_bodyScrollView.width, MAX(_bodyScrollView.height + 1, _userInfoBgView.maxY + KScaleWidth(8.0)));
    for (UIView *subView in self.userInfoBgView.subviews) {
        if ([subView isKindOfClass:[UILabel class]]) {
            ((UILabel *)subView).text = detailModel.authorVo.nickname;
        }
        else if ([subView isKindOfClass:[UIImageView class]]) {
            [(UIImageView *)subView sd_setImageWithURL:[NSURL URLWithString:detailModel.authorVo.avatar] placeholderImage:ImageNamed(@"mine_avatar_icon")];
        }
    }
    XMUserModel *userModel = [[XMUserManager shareInstance] getUser];
    _bottomView.hidden = [userModel.userId isEqualToString:detailModel.authorVo.objectId];
    _collectBtn.selected = [detailModel.collectionStatus isEqualToString:@"1"];
}

- (void)collectSuccessWithStatus:(NSString *)collectStatus {
    _collectBtn.selected = [collectStatus isEqualToString:@"1"];
}

#pragma mark - BtnAction
//关注
- (void)attentionAction:(UIButton *)button {
    if (self.delegate && [self.delegate respondsToSelector:@selector(attentionActionWithAttentionStatus:)]) {
        [self.delegate attentionActionWithAttentionStatus:_attentionStatus];
    }
}

//分享
- (void)shareAction:(UIButton *)butotn {
    if (self.delegate && [self.delegate respondsToSelector:@selector(shareAction)]) {
        [self.delegate shareAction];
    }
}

//展开
- (void)openAction:(UIButton *)button {
    
}

//进入主页
- (void)goHomePageAction:(UIButton *)button {
    if (self.delegate && [self.delegate respondsToSelector:@selector(checkUserInfoWithUserId:)]) {
        [self.delegate checkUserInfoWithUserId:_userId];
    }
}

- (void)itemAction:(UIButton *)button {
    if ([button.titleLabel.text isEqualToString:@"收藏"]) {
        if (self.delegate && [self.delegate respondsToSelector:@selector(collectionAction)]) {
            [self.delegate collectionAction];
        }
    }
    else if ([button.titleLabel.text isEqualToString:@"聊一聊"]) {
        if (self.delegate && [self.delegate respondsToSelector:@selector(chatAction)]) {
            [self.delegate chatAction];
        }
    }
    else {
        if (self.delegate && [self.delegate respondsToSelector:@selector(meetBoxAction)]) {
            [self.delegate meetBoxAction];
        }
    }
}

- (void)addAction:(UIButton *)button {
    if (self.delegate && [self.delegate respondsToSelector:@selector(addMeetBoxAction)]) {
        [self.delegate addMeetBoxAction];
    }
}

- (void)orderAction:(UIButton *)button {
    if (self.delegate && [self.delegate respondsToSelector:@selector(orderAction)]) {
        [self.delegate orderAction];
    }
}

#pragma mark - Init
- (UIScrollView *)bodyScrollView {
    if (!_bodyScrollView) {
        _bodyScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, kNavagationBarH, self.width, self.height - kNavagationBarH - KScaleWidth(65.0) - kBottomLayout)];
        _bodyScrollView.backgroundColor = kColorHEX(0xF0F0F0);
    }
    return _bodyScrollView;
}

- (UIImageView *)topAvatarImgView {
    if (!_topAvatarImgView) {
        _topAvatarImgView = [[UIImageView alloc] initWithFrame:CGRectMake(KScaleWidth(36.0), kNavagationBarH - 44 + (44 - KScaleWidth(36.0))/2, KScaleWidth(36.0), KScaleWidth(36.0))];
        [_topAvatarImgView setCornerRadius:_topAvatarImgView.height/2];
    }
    return _topAvatarImgView;
}

- (UILabel *)topNameLabel {
    if (!_topNameLabel) {
        _topNameLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.topAvatarImgView.maxX + KScaleWidth(8.0), _topAvatarImgView.y, self.navView.width - _topAvatarImgView.maxX - KScaleWidth(8.0) - KScaleWidth(44.0) - KScaleWidth(50.0) - KScaleWidth(10.0), _topAvatarImgView.height) font:KFontSize(16.0) textColor:kColorHEX(0x333333)];
    }
    return _topNameLabel;
}

- (SDCycleScrollView *)sdcycleView {
    if (!_sdcycleView) {
        _sdcycleView = [SDCycleScrollView cycleScrollViewWithFrame:CGRectMake(KScaleWidth(8.0), KScaleWidth(8.0), self.width - KScaleWidth(8.0)*2, KScaleWidth(240.0)) imageNamesGroup:@[]];
        [_sdcycleView setCornerRadius:KScaleWidth(10.0)];
        _sdcycleView.showPageControl = YES;
        _sdcycleView.delegate = self;
    }
    return _sdcycleView;
}

- (UILabel *)priceLabel {
    if (!_priceLabel) {
        _priceLabel = [[UILabel alloc] initWithFrame:CGRectMake(KScaleWidth(8.0), self.sdcycleView.maxY + KScaleWidth(8.0), KScaleWidth(150.0), KScaleWidth(33.0))];
    }
    return _priceLabel;
}

- (UILabel *)titleLabel {
    if (!_titleLabel) {
        _titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(KScaleWidth(8.0), self.priceLabel.maxY, self.width - KScaleWidth(8.0)*2, KScaleWidth(28.0)) font:KFontSize(16.0) textColor:kColorHEX(0x333333)];
    }
    return _titleLabel;
}

- (UIView *)meetInfoView {
    if (!_meetInfoView) {
        _meetInfoView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.width, KScaleWidth(120.0))];
        _meetInfoView.backgroundColor = kColorHEX(0xffffff);
    }
    return _meetInfoView;
}

- (UILabel *)addressLabel {
    if (!_addressLabel) {
        _addressLabel = [[UILabel alloc] initWithFrame:CGRectMake(KScaleWidth(100.0), 0, self.width - KScaleWidth(100.0) - KScaleWidth(10.0), KScaleWidth(40.0)) font:KFontSize(15.0) textColor:kColorHEX(0x333333)textAlignment:NSTextAlignmentRight];
    }
    return _addressLabel;
}

- (UILabel *)startTimeLabel {
    if (!_startTimeLabel) {
        _startTimeLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.width/2, KScaleWidth(40.0), self.width/2 - KScaleWidth(10.0), KScaleWidth(40.0)) font:KFontSize(15.0) textColor:kColorHEX(0x333333) textAlignment:NSTextAlignmentRight];
    }
    return _startTimeLabel;
}

- (UILabel *)endTimeLabel {
    if (!_endTimeLabel) {
        _endTimeLabel = [[UILabel alloc] initWithFrame:self.startTimeLabel.frame font:KFontSize(15.0) textColor:kColorHEX(0x333333) textAlignment:NSTextAlignmentRight];
        _endTimeLabel.y = KScaleWidth(40.0)*2;
    }
    return _endTimeLabel;
}

- (UIView *)descriptionView {
    if (!_descriptionView) {
//        _descriptionView = [[UIView alloc] initWithFrame:CGRectMake(KScaleWidth(8.0), KScaleWidth(30.0), self.width - KScaleWidth(8.0)*2, KScaleWidth(108.0))];
        _descriptionView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.width, KScaleWidth(178.0))];
        _descriptionView.backgroundColor = kColorHEX(0xffffff);
    }
    return _descriptionView;
}

- (UILabel *)descriptionLabel {
    if (!_descriptionLabel) {
        _descriptionLabel = [[UILabel alloc] initWithFrame:CGRectMake(KScaleWidth(8.0), KScaleWidth(30.0), self.width - KScaleWidth(8.0)*2, KScaleWidth(108.0)) font:KFontSize(14.0) textColor:kColorHEX(0x666666)];
    }
    return _descriptionLabel;
}

- (UIView *)evaluateBgView {
    if (!_evaluateBgView) {
        _evaluateBgView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.width, KScaleWidth(290.0))];
        _evaluateBgView.backgroundColor = kColorHEX(0xffffff);
    }
    return _evaluateBgView;
}

- (XMEvaluateView *)evaluateView {
    if (!_evaluateView) {
        _evaluateView = [[XMEvaluateView alloc] initWithFrame:CGRectMake(0, KScaleWidth(38.0), self.width, KScaleWidth(205.0))];
    }
    return _evaluateView;
}

- (UIView *)userInfoBgView {
    if (!_userInfoBgView) {
        _userInfoBgView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.width, KScaleWidth(73.0))];
        _userInfoBgView.backgroundColor = kColorHEX(0xffffff);
    }
    return _userInfoBgView;
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
